#pragma once
#include <d3d9.h>
#include <d3dx9.h>
#include <dinput.h>
#include <Windows.h>

class CInput
{
private:
	// private variables
	LPDIRECTINPUT8 m_input;
	LPDIRECTINPUTDEVICE8 m_keyboard;
	LPDIRECTINPUTDEVICE8 m_mouse;
	char m_buffer[256];
	char m_keyState[256];
	char m_prevKeyState[256];
	DIMOUSESTATE m_mouse_state;
public:
	// constructor & destructor
	CInput(void);
	~CInput(void);
	CInput(HWND hWnd);
	// methods
	void CreateInterface();
	void Setting(HWND hWnd);
	HRESULT GetKeyboardState();
	HRESULT GetMouseState();
	bool KeyDown(int key);
	bool KeyUp(int key);
	bool KeyPressed(int key);

	void KillKeyboard();
	void KillMouse();
};

